#ifndef VENDOR_ECARX_IPLM_V1_0_UTILS_H
#define VENDOR_ECARX_IPLM_V1_0_UTILS_H

#include "Def.h"

typedef uint8_t UINT8;
typedef uint16_t UINT16;
typedef uint32_t UINT32;

/********************************************************************************
** Macros to get and put bytes to and from a stream (Big Endian format)
*/
#define UINT32_TO_BE_STREAM(p, u32) {*p++ = (UINT8)((u32) >> 24); *p++ = (UINT8)((u32) >> 16); *p++ = (UINT8)((u32) >> 8); *p++ = (UINT8)(u32); }
#define UINT16_TO_BE_STREAM(p, u16) {*p++ = (UINT8)((u16) >> 8); *p++ = (UINT8)(u16);}
#define UINT8_TO_BE_STREAM(p, u8)   {*p++ = (UINT8)(u8);}
#define BE_STREAM_TO_UINT8(u8, p)   {u8 = (UINT8)(*(p)); (p) += 1;}
#define BE_STREAM_TO_UINT16(u16, p) {u16 = (UINT16)(((UINT16)(*(p)) << 8) + (UINT16)(*((p) + 1))); (p) += 2;}
#define BE_STREAM_TO_UINT32(u32, p) {u32 = ((UINT32)(*((p) + 3)) + ((UINT32)(*((p) + 2)) << 8) + ((UINT32)(*((p) + 1)) << 16) + ((UINT32)(*(p)) << 24)); (p) += 4;}

// namespace vendor {
// namespace ecarx {
// namespace xma {
// namespace iplm {
// namespace V1_0 {
// namespace implementation {

// static void convertToBigEndian(iplm_activity_t * packet);
// static void convertToLittleEndian(iplm_activity_t * packet);

// } // namespace implementation
// } // namespace V1_0
// } // namespace iplm
// } // namespace xma
// } // namespace ecarx
// } // namespace vendor

#endif /* VENDOR_ECARX_IPLM_V1_0_UTILS_H */